<#import '/ftlLibrary/properteisVariable.ftl' as pv/>
<link href="assets/css/bootstrap-select.css" rel="stylesheet"/>
<link href="assets/css/front/listCommonStyle.css" rel="stylesheet"/>
<link href="assets/css/modify.css" rel="stylesheet"/>
<script src="assets/js/select2/select2.js"></script>
<div class="row margin-left-10">
    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
        <div class="widget flat margin-top-0" style="margin: -10px 0 0px 0!important;">
            <div class="widget-header bordered-sky theme-bordered nopadding">
                <div class="widget-buttons widget-label nomargin-bottom">
                    <label class="businessBtns">
                        <ol class="breadcrumb" style="margin: 0;">
                            <li style="color: #809fa6;">统计报表</li>
                            <li class="active" style="color: #23a8f5;">会员剩余课时统计</li>
                        </ol>
                    </label>
                </div>
            </div>
        </div>
    </div>
    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 ">
        <div class="widget flat searchCriteria " style="margin: 3px 0 0px 0!important;padding-bottom: 10px">
            <div class="widget-header bordered-sky theme-bordered nopadding">
                <div class="widget-buttons widget-label nomargin-bottom">
                    <label class="businessBtns">
                        <a type="btn" class="btn parentChildBtn"
                           style="background-color: #23a8f5;border: none;border-top-left-radius: 4px!important;border-bottom-left-radius: 4px!important;width: 140px;color: #fff;margin-right: 0!important;box-shadow:0px 0px 10px rgba(122,161,184,0.3);">
                            亲子会员课时统计
                        </a><a type="btn" class="btn interimBtn"
                               style="border: none;border-top-right-radius: 4px!important;border-bottom-right-radius: 4px!important;width: 140px;color: #4a647d;box-shadow:0px 0px 10px rgba(122,161,184,0.3);">
                        过渡会员课时统计
                    </a>
                        <input type="hidden" value="" name="memberType"/>
                    </label>

                    <label class="pull-right businessBtns">
                        <label class="margin-right-20">
                            <a style="border-radius: 0px;border: none;background: #23a8f5 !important;"
                               class="btn btn-blue shiny download" onclick="exportData('${searchFormId}','MemberInformation.xlsx')"><i class="fa fa-share"></i>导出
                            </a>
                        </label>
                        <label class="margin-right-20">
                            <a style="border-radius: 0px;border: none;background: #ffab00 !important;"
                               class="btn btn-warning shiny search "><i class="fa fa-search"></i>搜索
                            </a>
                        </label>
                        <label onclick="iconsChange()" style="margin-right: 6px">
                            <label>
                                <a class="iconsChangeA" style="width: 13px;height: 13px;cursor: pointer;background: url('assets/img/nav-img/icon_hidden.png');display: block;-webkit-user-select:none; -moz-user-select:none; -ms-user-select:none;user-select:none;" value="1"></a>
                            </label>
                            <label style="color: #23a8f5 ;vertical-align: middle;padding-top:4px;">
                                <span class="iconsChangeSpan" style="-webkit-user-select:none; cursor: pointer;-moz-user-select:none; -ms-user-select:none;user-select:none;">隐藏搜索栏</span>
                            </label>
                        </label>
                    </label>
                </div>
            </div>
        </div>
            <div class="search_Bar" style="vertical-align: middle;clear: both;">
                <form id="${searchFormId}" action="${actionUrl}" class="searchConditions" method="POST">
                    <div class="row searchInput" style="margin: 0;">
                        <label class="iconchange1 hidden" style="position: absolute;right: 10px;top: 50px;" >
                            <a class="search_Bar_A" style="color: #2a6496;cursor: pointer;" onclick="iconchangeShow(this)" value="1">筛选更多<i class="fa fa-chevron-down" style="padding-left: 5px"></i></a>
                        </label>
                        <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                            <label style="width: 78px">会员姓名：</label>
                            <label>
                                <input type="text" name="id" value="${search_map.id[0]}" style="width: 200px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;">
                            </label>
                        </label>
                        <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                            <label style="width: 78px">会员昵称：</label>
                            <label>
                                <input type="text" name="nickName" value="${search_map.nickName[0]}" style="width: 200px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;">
                            </label>
                        </label>
                        <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                            <label style="width: 78px">会员生日：</label>
                            <label>
                                <input type="text" name="birthdayDate_begin" value="${search_map.birthdayDate_begin[0]}" style="width: 90px;height: 30px!important;padding-left:3px!important;border: 1px solid #c6d5d8;border-radius: 4px !important;"> 至
                                <input type="text" name="birthdayDate_end" value="${search_map.birthdayDate_end[0]}" style="width: 90px;height: 30px!important;padding-left:3px!important;border: 1px solid #c6d5d8;border-radius: 4px !important;">
                            </label>
                        </label>
                        <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                            <label style="width: 78px">联系方式：</label>
                            <label>
                                <input type="text" name="contactPhone" value="${search_map.contactPhone[0]}" style="width: 200px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;">
                            </label>
                        </label>
                        <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                            <label style="width: 78px">剩余课次：</label>
                            <label>
                                <input type="text" name="surplusClassHours_begin" value="${search_map.surplusClassHours_begin[0]}" style="width: 90px;height: 30px!important;padding-left:3px!important;border: 1px solid #c6d5d8;border-radius: 4px !important;"> 至
                                <input type="text" name="surplusClassHours_end" value="${search_map.surplusClassHours_end[0]}" style="width: 90px;height: 30px!important;padding-left:3px!important;border: 1px solid #c6d5d8;border-radius: 4px !important;">
                            </label>
                        </label>
                        <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                            <label style="width: 78px">剩余赠送课次：</label>
                            <label>
                                <input type="text" name="surplusPresentClassHours_begin" value="${search_map.surplusPresentClassHours_begin[0]}" style="width: 90px;height: 30px!important;padding-left:3px!important;border: 1px solid #c6d5d8;border-radius: 4px !important;"> 至
                                <input type="text" name="surplusPresentClassHours_end" value="${search_map.surplusPresentClassHours_end[0]}" style="width: 90px;height: 30px!important;padding-left:3px!important;border: 1px solid #c6d5d8;border-radius: 4px !important;">
                            </label>
                        </label>
                        <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                            <label style="width: 78px">剩余金额：</label>
                            <label>
                                <input type="text" name="balances_begin" value="${search_map.balances_begin[0]}" style="width: 90px;height: 30px!important;padding-left:3px!important;border: 1px solid #c6d5d8;border-radius: 4px !important;"> 至
                                <input type="text" name="balances_end" value="${search_map.balances_end[0]}" style="width: 90px;height: 30px!important;padding-left:3px!important;border: 1px solid #c6d5d8;border-radius: 4px !important;">
                            </label>
                        </label>
                        <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                            <label style="width: 78px">日期范围：</label>
                            <label>
                                <input id="d4313" type="text" name="startTime_begin" class="beginValue Wdate" value="${search_map.startTime_begin[0]}"
                                       onFocus="WdatePicker({doubleCalendar:false,maxDate:'#F{$dp.$D(\'d4314\')}',dateFmt:'yyyy-MM-dd'})" style="width: 90px;height: 30px!important;padding-left:3px!important;border: 1px solid #c6d5d8;border-radius: 4px !important;"> 至
                                <input id="d4314"  type="text" name="endTime_end" class="endValue Wdate"  value="${search_map.endTime_end[0]}"
                                       onFocus="WdatePicker({doubleCalendar:false,minDate:'#F{$dp.$D(\'d4313\')}',dateFmt:'yyyy-MM-dd'})" style="width: 90px;height: 30px!important;padding-left:3px!important;border: 1px solid #c6d5d8;border-radius: 4px !important;">
                            </label>
                        </label>
                    </div>
                </form>
            </div>
            <div class="widget flat radius-bordered" style="margin-top: 0;box-shadow:0px 0px 10px rgba(122,161,184,0.3);">
                <div class="widget-body no-padding">
                    <div class="topPagingBar hidden">
                        ${pagingBar}
                    </div>
                    <div class="table-scrollable" style="border: none;" id="tableScrollable">
                        <!-- 数据表列信息列表 -->
                        <table class="table table-hover dataTable newtable">
                            <thead>
                            <tr>
                                <th title="选择" class="checkboxColumnTh">
                                    <div class="checkbox">
                                        <label>
                                            <input type="checkbox" class="chkAll" onclick="chkAll()">
                                            <span class="text"></span>
                                        </label>
                                    </div>
                                </th>
                                <th title="属性名">序号</th>
                                <th title="会员姓名">会员姓名</th>
                                <th title="会员生日">会员生日</th>
                                <th title="联系方式">联系方式</th>
                                <th title="总出勤次数">总出勤次数</th>
                                <th title="已消耗出勤次数">已消耗出勤次数</th>
                                <th title="剩余出勤次数">剩余出勤次数</th>
                                <th title="剩余赠送出勤次数">剩余赠送出勤次数</th>
                                <th title="剩余出勤次数金额">剩余出勤次数金额</th>
                                <th title="剩余材料费">剩余材料费</th>
                            </tr>
                            </thead>
                            <tbody>
                            <#if page_bean.list?size==0>
                                <tr>
                                    <td align="center">无数据</td>
                                </tr>
                            </#if>
                            <#list page_bean.list as data>
                                <tr>
                                    <td class="checkboxColumnTd">
                                        <div class="checkbox">
                                            <label>
                                                <input type="checkbox" class="chk" name="id" value="${data.id}">
                                                <span class="text"></span>
                                            </label>
                                        </div>
                                    </td>
                                    <td>${data_index+1+(page_bean.pageNo-1)*page_bean.pageSize}</td>
                                    <td>${(data.studentName???string(data.studentName?html,"未设置"))!'未设置'}</td>
                                    <td>${(data.birthdayDate???string(data.birthdayDate?html,"未设置"))!'未设置'}</td>
                                    <td>${(data.contactPhone???string(data.contactPhone?html,"未设置"))!'未设置'}</td>
                                    <td>
                                        ${(data.attendanceDays???string(data.attendanceDays?html,"未设置"))!'未设置'}
                                        <span class="text">+</span>
                                        ${(data.giftAttendanceDays???string(data.giftAttendanceDays?html,"未设置"))!'未设置'}
                                    </td>
                                    <td>${(data.consumptionAttendanceDays???string(data.consumptionAttendanceDays?html,"未设置"))!'未设置'}</td>
                                    <td>${(data.surplusAttendanceDays???string(data.surplusAttendanceDays?html,"未设置"))!'未设置'}</td>
                                    <td>${(data.surplusPresentAttendanceDays???string(data.surplusPresentAttendanceDays?html,"未设置"))!'未设置'}</td>
                                    <td>${(data.balances???string(data.balances?html,"未设置"))!'未设置'}</td>
                                    <td>${(data.mealFeeAmout???string(data.mealFeeAmout?html,"未设置"))!'未设置'}</td>
                                </tr>
                            </#list>
                            </tbody>
                        </table>
                    </div>
                    ${pagingBar}
                </div>
            </div>
        </div>
    </div>
<script>
    $(".selectpicker").select2();

    /*$(function(){
        alert(${packageType});
        var packageType = $("#packageType").val();
        alert(packageType);
        $("#packageType").find("option[value='1']").attr("selected",true);
    });*/
    $(".parentChildBtn").click(function () {
        /*$(".packageType").val(1);
        $(".parentChild").removeClass("hidden").addClass("show");
        $(".interim").removeClass("show").addClass("hidden");
        $('.parentChildBtn').css("background","#5db2ff");
        $('.interimBtn').css("background","#fff");
        $(".modal-title").html("亲子会员课时统计");
        var type = $(".packageType").val();*/
        //ajaxPackageList(1)
        javascript:toView('ViewConsultancyStatisticsController/parentingSurplusClassHourList.do',true,'POST',{pageSize:10})
    })
    $(".interimBtn").click(function () {
        /*$(".packageType").val(2);
        $(".interim").removeClass("hidden").addClass("show");
        $(".parentChild").removeClass("show").addClass("hidden");
        $('.interimBtn').css("background","#5db2ff");
        $('.parentChildBtn').css("background","#fff");
        $(".modal-title").html("过渡会员课时统计");
        var type = $(".packageType").val();*/
        //ajaxPackageList(2)
        javascript:toView('ViewConsultancyStatisticsController/transitionSurplusAttendanceDayList.do',true,'POST',{pageSize:10})
    })
    function ajaxPackageList(type) {
        ajaxRequest("ViewConsultancyStatisticsController/transitionClassHourList.do", {
            type: type
        }, function (result) {
            var data=result.data;

        }, function () {
            ajaxError("加载课程包失败")
        }, "get", "json")
    }

    //    隐藏显示搜索
    function iconsChange() {
        if($(".iconsChangeA").val()==1){
            $(".iconsChangeA").val("0");
            $(".iconsChangeA").css("background","url('assets/img/nav-img/icon_hidden.png')");
            $(".iconsChangeSpan").html("隐藏搜索栏");
            $(".search_Bar").removeClass("hidden");
        }else{
            $(".iconsChangeA").val("1");
            $(".iconsChangeA").css("background","url('assets/img/nav-img/icon_show.png')");
            $(".iconsChangeSpan").html("显示搜索栏");
            $(".search_Bar").addClass("hidden");
        }
    }

    //    筛选下拉框
    setTimeout(function () {
        var size = $(".search_Bar_item").size();
        if (size > 8) {
            $(".iconchange1").removeClass("hidden");
            $(".search_Bar_item").each(function () {
                var index = $(this).index();
                if (index <= 8) {
                    $(this).removeClass("hidden")
                }

            })
        } else {
            $(".iconchange1").addClass("hidden");
            $(".search_Bar_item").each(function () {
                $(this).removeClass("hidden")
            })
        }

    }, 10)

    function iconchangeShow(that) {

        if($(that).attr("value")==1){
            $(that).attr("value","0");
            $(".iconchange1 .fa").removeClass("fa-chevron-down").addClass("fa-chevron-up");
            $(".search_Bar_item").each(function () {
                $(this).removeClass("hidden")
            })
        }else{
            $(that).attr("value","1");
            $(".iconchange1 .fa").removeClass("fa-chevron-up").addClass("fa-chevron-down");
            $(".search_Bar_item").each(function () {
                var index = $(this).index();
                if (index <= 8) {
                    $(this).removeClass("hidden")
                }else{
                    $(this).addClass("hidden")
                }

            })
        }

    }
</script>